package com.qiyu.dubbo.router.starter.zone.nacos;

import com.alibaba.nacos.api.naming.NamingService;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.extension.ExtensionLoader;
import org.apache.dubbo.registry.nacos.NacosRegistry;

/**
 * @Author idea
 * @Date created in 5:32 下午 2020/11/25
 */
public class ZoneAwareNacosRegister extends NacosRegistry {

    private String zone;
    private String appId;

    public ZoneAwareNacosRegister(URL url, NamingService namingService) {
        super(url, namingService);
        this.zone="idea.branch";
        this.appId= String.valueOf(System.currentTimeMillis());
    }


    @Override
    public void doRegister(URL url) {
        url.addParameter("zone",zone).addParameter("appId",appId);
        super.doRegister(url);
    }
}
